var t = getApp();

Page({
    data: {},
    onLoad: function(t) {
        t.store_id && this.setData({
            store_id: t.store_id
        }), this.getData();
    },
    onClickleft: function() {
        wx.navigateBack({
            delta: 1
        });
    },
    goDetail: function() {
        wx.navigateTo({
            url: "/packageI/independenceBalance/storeBalanceDetail/storeBalanceDetail?store_id=" + this.data.store_id
        });
    },
    goStoreBalance: function() {
        wx.navigateTo({
            url: "/packageI/independenceBalance/storeBalance/balance_recharge?store_id=" + this.data.store_id
        });
    },
    onReady: function() {},
    onShow: function() {},
    onHide: function() {},
    onUnload: function() {},
    onPullDownRefresh: function() {},
    onReachBottom: function() {},
    onShareAppMessage: function() {},
    getData: function() {
        var a = this, e = t.getNetAddresss("plugin.store-cashier.frontend.store.balance.home.index");
        t._postNetWork({
            url: e,
            data: {
                store_id: this.data.store_id
            },
            success: function(e) {
                var n = e.data;
                1 == n.result ? (a.setData({
                    title: n.data.title,
                    store_name: n.data.store_name,
                    member_balance: n.data.member_balance,
                    show_button: n.data.show_button
                }), n.data.title && wx.setNavigationBarTitle({
                    title: n.data.title
                })) : t.tips(n.msg);
            },
            fail: function(t) {
                wx.showToast({
                    title: t.data.msg,
                    duration: 1e3,
                    icon: "none"
                });
            }
        });
    }
});